<template>
  <div style="margin:0  10px;">
    <el-dropdown trigger="click" @command="handleCommand">
      <span class="el-dropdown-link" style="color: #fff">
        语言切换<i class="el-icon-arrow-down el-icon--right"></i>
      </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item
          :disabled="$i18n.locale === 'zh'"
          command="zh"
          icon="el-icon-plus"
          >中文==={{ $i18n.locale }}</el-dropdown-item
        >
        <el-dropdown-item
          :disabled="$i18n.locale === 'en'"
          command="en"
          icon="el-icon-circle-plus"
          >英文</el-dropdown-item
        >
      </el-dropdown-menu>
    </el-dropdown>
  </div>
</template>
<script>
export default {
  name: 'Lang',
  data() {
    return {}
  },
  created() {
    // setTimeout(() => {
    //   this.$i18n.locale = 'en'
    //   // console.log(this.$i18n.locale, 7777)
    // }, 5000)
  },
  computed: {},
  methods: {
    handleCommand(command) {
      // this.$message('click on item ' + command)
      this.$i18n.locale = command
    }
  }
}
</script>
<style lang='less'  scoped>
</style>
